/**
 * @file xvideo_task.cpp
 * @brief
 * @author zhangyuhu (zhangyuhude@163.com)
 * @version v1.0
 * @date 2022-01-25
 *
 * @par 修改日志:
 */

#include "xvideo_task.h"
#include <sstream>
using namespace std;
int XVideoTask::Run()
{
    // ffmpeg -y -i test.mp4 -s 400x300 400.mp4 >log.txt 2>&1
    stringstream ss;
    ss << "ffmpeg -y -i " << in_path << " ";
    if (width > 0 && height > 0)
        ss << " -s " << width << "x" << height << " ";
    ss << out_path;
    ss << " >" << this_thread::get_id() << ".txt 2>&1";
    return system(ss.str().c_str());
}
